﻿namespace EFS.RC.SupervisorCentral.Controls.Agents.ACD.Busy.NotInHunt
{
	public partial class List : EFS.RC.SupervisorCentral.Controls.Agents.List
	{
		/// Constructor
		public List() : base()
		{
			InitializeComponent();
			controlRibbonNotInHunt.AgentList = this;
		}

		#region Properties
		/// Property GridAgents: Get
		protected override System.Windows.Controls.WrapPanel WrapPanelAgents
		{
			get
			{
				return wrapPanelNotInHunt;
			}
		}

		/// Property AgentStatuses: Get
		public override EFS.RC.CC.Messages.Agents.Status[] AgentItems
		{
			get
			{
				// create list
				System.Collections.Generic.List<EFS.RC.CC.Messages.Agents.Status> list = new System.Collections.Generic.List<EFS.RC.CC.Messages.Agents.Status>();

				// get array ACD
				EFS.RC.CC.Messages.Agents.Status[] statusArrayACD =
					EFS.RC.SupervisorCentral.Common.Session.Instance.AgentList.Filter(null, true, false, null, false, CustomerEndPoint.RequiredSkillId, true, CustomerEndPoint.PhoneUri);
				list.AddRange(statusArrayACD);

				// ribbon
				UpdateRibbon(list.ToArray());

				// ok
				return list.ToArray();
			}
		}

		/// Property ContactListItemNewInstance: Get
		protected override EFS.RC.SupervisorCentral.Controls.Agents.ContactListItem ContactListItemNewInstance
		{
			get
			{
				return new EFS.RC.SupervisorCentral.Controls.Agents.ContactListItemNotTalking();
			}
		}
		#endregion

		/// Update ribbon
		private void UpdateRibbon(EFS.RC.CC.Messages.Agents.Status[] statusArray)
		{
			// count
			controlRibbonNotInHunt.Count = statusArray.Length;
		}
	}

}